//
//  WordListViewCell.m
//  EnglishStudyApp
//
//  Created by Nong Trung Nghia on 10/18/12.
//  Copyright (c) 2012 abc. All rights reserved.
//

#import "WordListViewCell.h"
#import "ESWord.h"
@implementation WordListViewCell
@synthesize word=_word;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.backgroundColor=[UIColor whiteColor];
    }
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageView.image=[UIImage imageNamed:_word.imageName];
    self.imageView.frame=CGRectMake(5, 5, 80, 80);
    [self.imageView setContentMode:UIViewContentModeScaleAspectFit];
    
    self.textLabel.text=_word.enDescription;
    [self.textLabel setFrame:CGRectMake(95, 10, 200, 30)];
    self.detailTextLabel.text=_word.vnDescription;
    [self.detailTextLabel setFrame:CGRectMake(95, 50, 200, 30)];
}


-(void)setWord:(ESWord *)aWord{
    _word=aWord;
    [self layoutSubviews];
}

@end
